import java.io.*;
import java.util.*;

public class Files extends Directory {
    private String fileType;
    private String dir;
    private Vector vds; 

    public Files (String dir, String file_type) {
	super (dir);
	this.fileType = file_type;
	this.vds = getSubDirectories(); 
    }

    public Vector getFiles() {	
	Vector vfs = new Vector();
	if(vds == null || vds.isEmpty()) {
	    return vfs;
	}

	File tf = null;

	File flist[] = null;
	Enumeration enums = vds.elements();
	while(enums.hasMoreElements()) {
	    tf = new File((String)enums.nextElement());
	    flist = tf.listFiles();
	    for(int n=0; n<flist.length; n++) {
		if(flist[n].isFile() && (flist[n].getName()).endsWith(fileType)) {
		    vfs.add(flist[n].getPath());
		}
	    }
	}
	return vfs;
    }
}



